<template>
  <div>
    <ul class="mian-list">
      <li v-for="(item, index) in list" :key="item.id">
        {{ index + 1 }}:{{ item.content }}
        <button @click="del(index)">删除</button>
      </li>
    </ul>
  </div>
</template>
<script>
export default {
  name: "",
  data() {
    return {};
  },
  props: {
    list: {
      type: Array,
      //针对于复杂数据类型均需要写成函数形式
      /* default:()=>{
        return []
      } */
      default: () => [],
    },
  },
  created() {},
  computed: {},
  methods: {
    del(index) {
        this.$emit('del',index)
        
    }
  },
};
</script>
<style lang='less'  scoped>
</style>
